package org.dg.iag.util;

import org.dg.iag.conf.ApplicationProperties;

public class ApplicationConstants {
	public final static String APP_PATH		= "/iAG";
	public final static String IATI_STORAGE_PATH		= "/xml";
	public final static String IATI_STORAGE_PATH_TEMP	= "/xml_temp";
	public final static String CACHE_PATH		= "/cache";
	public final static String CREATE_STATS_CACHE_PATH		= "/xquery/write_cache.xql";
	public final static String CREATE_LISTS_CACHE_PATH		= "/xquery/caching.xql";
	public final static String STATS_PATH		= "/xquery/html_stats.xql";
	
	public final static String USERS_XML				= "/users.xml";
	public final static String SETTINGS_XML				= "/settings.xml";
	public final static String LOGS_XML_FOLDER			= "/logs";
	public final static String LOGS_XML_PATTERN			= LOGS_XML_FOLDER + "/logs_XXX.xml";
	
	public final static String WEBROOT				= "webroot/";
	
	public final static String WEBROOT_ABSOLUTE_PATH	= ApplicationProperties.APP_ABSOLUTE_PATH + WEBROOT;
	
	public final static String APP_REST_PATH		= ApplicationProperties.EXIST_REST + APP_PATH;
	public final static String ENTIRE_USERS_PATH	= ApplicationProperties.EXIST_REST + APP_PATH + USERS_XML;
	
	public final static String IATI_REGISTRY_PATH	= "http://iatiregistry.org/";
	public final static String IATI_API_REST_PATH	= "api/rest/package/";
	
	public final static String IATI_API_REST_FULL_PATH	= IATI_REGISTRY_PATH + IATI_API_REST_PATH;	
	
	public final static String COOKIE_USERNAME		= "username";
	public final static String COOKIE_SESSIONID		= "sessionid";
	
	public final static Long AJAX_MAX_CONNECTION_TIME	= 60000L;
	public final static Long AJAX_CHECK_WAIT_TIME		= 2000L;

	public final static String XPATH_URL_SEPARATOR		= "~";
	public final static String URL_API_OR_SEPARATOR		= ",";

	public final static String SETTINGS_PERIOD_DAILY		= "daily";
	public final static String SETTINGS_PERIOD_WEEKLY		= "weekly";
	public final static String SETTINGS_PERIOD_MONTHLY		= "monthly";
	
	public final static String SETTINGS_REFRESH_ALL			= "Automatically all";
	public final static String SETTINGS_REFRESH_FAILED		= "Automatically failed";
	
	public final static String SCHEDULE_MANAGER		= "scheduleManager";
	
	public final static int MAX_PARAMS_IN_QUERY		= 5;
	
	public final static String EXIST_USER		= "exuser";
	public final static String EXIST_PASSWORD	= "1at1";
	
	public final static int MAX_ITEMS_IN_QUERY	= 1000;
	
	public final static int NUM_OF_RETRIES_ON_FEED_FAIL = 2;
	
}